#!/bin/bash

curl -sL https://gitee.com/moonnow/sh/raw/master/echo/echo-35.sh | bash -s 'highseas-java >>> 开始打包'
sleep 1

cd /pkg/highseas-java
sleep 1

git checkout master
sleep 1
git pull
sleep 1
git checkout develop
sleep 1
git rebase master
sleep 1

./mci.sh
sleep 1

cd pro
sleep 1

version=$(head -n 1 /pkg/version.txt)
sleep 1
((version++))
sleep 1
echo "$version" > /pkg/version.txt
sleep 1

docker build -t registry.cn-zhangjiakou.aliyuncs.com/xtj-hs/keeping:data-analysis-$version .
sleep 1
docker push registry.cn-zhangjiakou.aliyuncs.com/xtj-hs/keeping:data-analysis-$version
sleep 1
docker rmi registry.cn-zhangjiakou.aliyuncs.com/xtj-hs/keeping:data-analysis-$version
sleep 1

curl -sL https://gitee.com/moonnow/sh/raw/master/echo/echo-32.sh | bash -s 'highseas-java >>> 打包完成'
sleep 1

echo -e "\033[36mhighseas-java镜像版本号\033[0m"' '"\033[33m>>>\033[0m"' '"\033[35mdata-analysis-$version\033[0m"
sleep 1
